import Vue from 'vue'
import App from './App'
import store from './store/store.js'
import api from '@/common/http/'
import util from 'common/api_sign/request.js'
import liveutil from 'common/api_sign/liverequest.js'
import uploadType from 'common/api_sign/uploadconfig.js'
import config from "common/config.js"

import filters from './store/filters.js';
import VueClipboard from 'vue-clipboard2'

Vue.use(VueClipboard);

Vue.config.productionTip = false
if (process.env.NODE_ENV !== 'production') {
  // console.log = () => {}//开发环境去除看一下效果
} else {
  //正式环境去除
  console.log = () => { }
}
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));
Vue.prototype.$store = store
Vue.prototype.$uploadType = uploadType//上传文件分类
// Vue.prototype.$share = "https://tm.ehmall.com.cn"//分享域名
// Vue.prototype.$share = "https://aiteshop.com.cn/h5"//测试分享域名
Vue.prototype.$share = "https://uriwin.com/h5"//正式分享域名

// Vue.prototype.$apiurl='https://pcw.ehmall.com.cn/mobile/'//接口域名
// Vue.prototype.$apiurl='https://aiteshop.com.cn/mobile/'//测试接口域名
Vue.prototype.$apiurl = 'https://uriwin.com/mobile/'//正式接口域名
Vue.prototype.$base_url = 'https://funeral.oss-cn-shenzhen.aliyuncs.com/common';//http.requestUrl
Vue.prototype.$util = util//签名文件
Vue.prototype.$liveutil = liveutil
//微信公众号登录授权url配置
Vue.prototype.$wxOfficialAccountUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx25db10c56d93f3d1";

Vue.filter('tel11', (e) => {
  if (!(/^1[3456789]\d{9}$/.test(e))) {
    uni.showToast({
      title: "手机号码有误，请重填"
    })
    return false;
  }
})

Vue.mixin({
  // 这里为了解决 .vue文件中 template 无法获取 VUE.prototype 绑定的变量
  computed: {
    picUrl() {
      return config.picUrl
    },
  },
})

App.mpType = 'app'

const app = new Vue({
  ...App,
  store
})
app.$mount()
